package com.minimalist.common.entity.basic.vo.post;

import com.minimalist.common.config.mybatis.bo.PageReq;
import com.minimalist.common.config.swagger.SchemaEnum;
import com.minimalist.common.entity.basic.enums.StatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author 11987
 */
@Schema(name = "岗位查询实体")
public class PostQueryVO extends PageReq implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(name = "postName", description = "岗位名称", type = "string")
    private String postName;

    @Schema(name = "postCode", description = "岗位编码", type = "string")
    private String postCode;

    @SchemaEnum(implementation = StatusEnum.class)
    @Schema(name = "status", description = "岗位状态", type = "integer")
    private Integer status;

    public String getPostName(){
        return postName;
    }

    public void setPostName(String postName){
        this.postName = postName;
    }

    public String getPostCode(){
        return postCode;
    }

    public void setPostCode(String postCode){
        this.postCode = postCode;
    }

    public Integer getStatus(){
        return status;
    }

    public void setStatus(Integer status){
        this.status = status;
    }

    public PostQueryVO(Long pageNum, Long pageSize){
        super(pageNum, pageSize);
    }

    public PostQueryVO(Long pageNum, Long pageSize, String postName, String postCode, Integer status){
        super(pageNum, pageSize);
        this.postName = postName;
        this.postCode = postCode;
        this.status = status;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }
        PostQueryVO that = (PostQueryVO) o;
        return java.util.Objects.equals(postName, that.postName) &&
                java.util.Objects.equals(postCode, that.postCode) &&
                java.util.Objects.equals(status, that.status);
    }

    @Override
    public int hashCode(){
        return java.util.Objects.hash(super.hashCode(), postName, postCode, status);
    }

    @Override
    public String toString(){
        return "PostQueryVO{" +
                "postName='" + postName + '\'' +
                ", postCode='" + postCode + '\'' +
                ", status=" + status +
                "} " + super.toString();
    }

}
